import java.util.Arrays;

public class Solution1033 {
    public int[] numMovesStones(int a, int b, int c) {
        int[] f=new int[]{a,b,c};
        Arrays.sort(f);
        int min;
        if (f[1]-f[0]==1 && f[2]-f[1]==1){
            min=0;
        }else if (f[1]-f[0]<=2 || f[2]-f[1]<=2){
            min=1;
        }else {
            min=2;
        }
        int max=f[2]-f[0]-2;
        return new int[]{min,max};
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution1033().numMovesStones(1, 2, 5)));
    }
}
